package com.example.common.enums;

import lombok.Getter;

/**
 * 错误码枚举类
 */
public enum ErrorCodeEnum {
    SUCCESS(0, "Success"),
    UNAUTHORIZED(401, "未授权"),

    PARAM_ERROR(1001, "Parameter error"),
    USER_NOT_FOUND(1002, "User not found"),
    PERMISSION_DENIED(1003, "Permission denied"),
    INTERNAL_SERVER_ERROR(500, "Internal server error"),
    ROLE_NOT_FOUND(1004, "Role not found"),
    USERNAME_EXISTS(1005, "Username exists"),
    USER_REGISTER_FAILED(1006, "User register failed" ),
    BIND_ROLE_FAILED(1007, "Bind role failed" ),
    PASSWORD_ERROR(1008, "Password error" ),
    GET_USER_ROLE_FAILED(1009 , "Get user role failed" ),
    USER_UPDATE_FAILED(1010, "User update failed" ),
    PASSWORD_RESET_FAILED(1011, "Password reset failed" );
    
    private final int code;
    private final String message;
    
    ErrorCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}